REGISTER tw.jar;
log0 = LOAD '/hnbc/' USING PigStorage('\u0001') AS (line:chararray);
log1 = FOREACH log0 GENERATE FLATTEN(com.zbl.udf.LogFormat(line)) as (datetime:chararray,domain:chararray,province:chararray,type:chararray);
logtemp = FILTER log1 BY domain!='N';
log8 = GROUP logtemp BY domain;
log9 = FOREACH log8 GENERATE group ,COUNT(logtemp) as num;
log10 = ORDER log9 BY num DESC;
STORE log10 INTO '/tw/result/' USING PigStorage(); 